The present invention relates to programmable logic controller, and more particularly, relates to event-driven programmable logic controller and event-driven programming method thereof.
Programmable logic controller (PLC) plays an important role in the field of industrial control due to its flexibility in being programmable by the user. The programming methods of the existing programmable logic controller and the corresponding user application programs are based on scan cycle. The scan cycle has several steps, comprising: updating the input value, executing the user application, and refreshing the output value.
However, programming methods according to scan cycle have the following disadvantages:
Slow response to event. The user needs to detect the input event in application program, and the response cannot be outputted until the end of scan cycle.
Complicated user applications which are not easy to write. For programmable logic controllers according to scan cycle, the user application is responsible for event detecting and handling.
Poor readability of user application, which makes it difficult to maintain. For programmable logic controller according to scan cycle, the user needs to integrate the processing procedure of various events such as input/output event, diagnostic event, system event and so on in a single program, therefore the user application is poorly structured.